<template>
  <div style="clear: both;">
    	<button id="upload" @click="put()">上传</button>
    	<input id="file" type="file" @change='upload'   multiple/>
    </div>
</template>
<script type="text/ecmascript-6">
import  client  from '../fileupload/upload.js';
export default {
     data() {
          return {
            file:'',
          };
        },
        methods: {
          upload(e){
            this.file = e.target.files[0]
          },
          put(){
          var data = this.file
             client.put(
           '电脑/test.jpg',
           data,
           {
             headers:{
               "Content-Disposition":"inline",
               "Content-Type":'image/jpg'
             }
           }
           ).then((result)=>{
             console.log(result.url)
           });
          },
        },
}
</script>
